package com.macro.mall.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Created by @author dabaoqiang on 2024/5/26.
 */
public class UmsMemberFieldEnum {

    /**
     * 1-> 打卡 2-> 请假 3-> 旷卡
     */
    @Getter
    @AllArgsConstructor
    public enum sourceType {
        KLYX(1, "结缘2023期"),
        WEST(2, "西天群"),
        SOCAIL(3, "社会");
        private final Integer no;
        private final String desc;

        /**
         * 匹配枚举值
         *
         * @param id 名称
         * @return MailModuleEnum
         */
        public static UmsMemberFieldEnum.sourceType of(Integer id) {
            if (id == null) {
                return null;
            }
            UmsMemberFieldEnum.sourceType[] values = UmsMemberFieldEnum.sourceType.values();
            for (UmsMemberFieldEnum.sourceType moduleEnum : values) {
                if (moduleEnum.getNo().equals(id)) {
                    return moduleEnum;
                }
            }
            return null;
        }

    }
}
